package com.example.dao;

import com.example.model.OrderUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.nio.file.attribute.UserPrincipal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Hello
 * @since 2024-07-03
 */
public interface OrderUserMapper extends BaseMapper<OrderUser> {

    /*@Select("SELECT * FROM order_user WHERE ifdine=1 ")
    List<OrderUser> getAllDingin();

    @Select("SELECT * FROM order_user WHERE ifdine=0")
    List<OrderUser> getAllTakeAway();*/

    @Select("SELECT * FROM order_user WHERE user_id=#{userId}")
    List<OrderUser> getByUserId(@Param("userId") Integer userId);
    @Select("SELECT * FROM order_user WHERE ifdine=1 AND user_id=#{userId}")
    List<OrderUser> getDinginByUserId(@Param("userId")Integer userId);

    @Select("SELECT * FROM order_user WHERE ifdinein=0 AND user_id=#{userId}")
    List<OrderUser> getTakeAwayByUserId(@Param("userId")Integer userId);
}
